home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 2001 January / CT_SW0101.ISO / pc / software / kommunik / multimed / snakcarb.sit / Snak 4.6.3 Carbon / Scripts / OnJoin < prev    next >
Text File  |  2000-04-23  |  2KB  |  49 lines

  1. # Lines with '#' are comments that are not executed
  2.  
  3. # This file contains an example of an "auto greet" function.
  4. # Whenever someone joins the channel that you specify in the greetchannel 
  5. # variable, the script will say "Welcome to <channel> <nick>"
  6.  
  7. # This is actually fairly obnoxious. Most people disprove of auto greets
  8. # and it is only included here as an example
  9.  
  10. # To automatically load this into a connection, add "/load OnJoin" to the startup actions.
  11.  
  12.  
  13. # This line creates a variable that holds the name of the channel
  14. # that the function operates on.
  15.  
  16. assign greetchannel #chatzone
  17.  
  18.  
  19. # The next part is the actual event handler script. Snak calls the handler
  20. #  when someone joins any channel that you are a member of.
  21.  
  22. # Input:
  23. # $0 : nick!userhost
  24. # $1 : channel name
  25.  
  26. # First the script tests if the channel name is the one it should react to.
  27. # then it formats a message that is sent to the channel, welcoming the new user.
  28.  
  29. # In order for you to see what it does it also writes the message to the window
  30.  
  31. on -join * {
  32.     if ([$1] == [$greetchannel])
  33.     {
  34.         quote PRIVMSG $1 :Welcome to $1 $nickonly($0)
  35.         echo Welcome to $1 $nickonly($0)
  36.     }
  37. }
  38.  
  39. # The character in front of the join determines how Snak continues processing.
  40. # A '^' stops further processing of the event.
  41. # A '-' lets Snak continue processing. This will cause the normal join
  42. # message to appear: "<nick> has joined the channel".
  43.  
  44. # This script uses the $nickonly function from the Basical script file.
  45. # The function splits the nick!userhost string and returns the nick.
  46.  
  47. # The echo function will display the text locally
  48. # The say function will send the text to the channel
  49.